﻿
$(document).ready(function() {
    JSUtility.url = '../Handler/AjaxHandle.ashx';
    JSUtility.param = { AssemblyName: "OA.Bll.Personnel", ClassName: "OA.Bll.Personnel.QualificationCertificatePresenter", Method: "Paged", Options: {} };
    top.autoResize({ dataGrid: '#Grid', callback: QualificationCertificate, par: { }, method: 'Paged' });
    JSUtility.window_edit_form = $("#QualificationCertificateWin").find("form");
    JSUtility.window_edit = $("#QualificationCertificateWin");
    $("#btnAdd").click(function() {
        JSUtility.add();
    });
    $("#btnDel").click(JSUtility.del);
    $("#btnEdit").click(JSUtility.update);
    $("#btnSubmit").click(function() {
        JSUtility.param.Options["EmployeeID"] = $("#EmployeeID").combotree('getValue');
        JSUtility.save();
    });
});

function QualificationCertificate(op, method, size) {
    var p = JSUtility.param;
    p.Method = "Search";
    JSUtility.grid = $('#Grid').datagrid({
        fitColumns: true,
        width: size.width,
        height: size.height-20,
        pageSize: Math.round(size.height / 25),
        pageList: [Math.round(size.height / 25)],
        striped: true,
        queryParams: { "json": $.toJSON(p) },
        url: JSUtility.url,
        singleselect: true
    });
}